/**
 * \file GUIPlugin.cpp
 * \brief GUIPlugin decleration class for windows plugin
 * \author Edouard ROGE
 * \date 24 Novembre 2013
 */

#include "Core/Profile/Profiler.h"
#include "Core/Profile/CodeProfile.h"
#include "Core/Thread/ThreadManager.h"
#include "Core/Log/LogManager.h"
#include "GUIContext.h"
#include "GUIPlugin.h"

namespace GUI
{
	namespace Win32
	{

		GUIPlugin::GUIPlugin()
		{
		}

		GUIPlugin::~GUIPlugin()
		{
			Core::Thread::ThreadManager::GetInstance().Clear();
			Core::Memory::MemoryPoolManager::GetInstance().CheckLeaks(false);

			Core::Thread::ThreadManager::DeleteInstance();
			Core::Log::LogManager::DeleteInstance();
			Core::Profile::Profiler::DeleteInstance();
			Core::Memory::MemoryPoolManager::DeleteInstance();
		}

		const std::string & GUIPlugin::GetName() const
		{
			static std::string strName = "GUI Windows Plugin";
			return strName;
		}

		Core::GUI::IGUIContext * GUIPlugin::CreateContext() const
		{
			return new GUIContext();
		}

		void GUIPlugin::DestroyContext(Core::GUI::IGUIContext * _pContext) const
		{
			if (_pContext)
			{
				delete (GUIContext*)_pContext;
			}
		}
	}
}
